home *** CD-ROM | disk | FTP | other *** search
/ The Illustrated Works of Shakespeare / Illustrated Works of Shakespeare, The (1990)(Animated Pixels)[!][CDTV-PC].iso / amos_system / lock.amos / lock.amosSourceCode
AMOS Source Code  |  1991-04-10  |  1KB  |  63 lines

  1. '----------------------------------------------------------------------------
  2. '
  3. ' AMOS Procedure Locker, by Francois Lionet. AMOS 1.2 and over ONLY! 
  4. '
  5. '----------------------------------------------------------------------------
  6. '
  7. '    To use, load this program as an accessory. Load your program in editor, 
  8. ' then call this program. It will lock all CLOSED procedures.  
  9. '    They will be definitively LOCKED! So be very carefull to have a 
  10. ' backup!  
  11. '
  12. '----------------------------------------------------------------------------
  13. '
  14. Default Palette 0,0,$FFF,0
  15. Screen Open 7,640,72,4,Hires : Curs Off 
  16. Screen Display 7,,100,,
  17. Centre At(,2)+Border$("   AMOS Procedures locker   ",1)
  18. Locate 0,5
  19. '
  20. If Areg(3)=0
  21.    Centre "Sorry! I only work with AMOS 1.2 and over!"
  22.    BYEBYE
  23. End If 
  24. '
  25. If Dreg(0)=0
  26.    Centre "You must call me as an accessory!"
  27.    BYEBYE
  28. End If 
  29. '
  30. LOCKIT
  31. BYEBYE
  32. '
  33. Procedure LOCKIT
  34.    AD=Areg(3)
  35.    TKPROC=$376
  36.    Do 
  37.       L=Peek(AD)*2
  38.       Exit If L=0
  39.       If Deek(AD+2)=TKPROC
  40.          P=Deek(AD+10)
  41.          If Btst(15,P)
  42.             Bset 14,P
  43.             P=(P and $FF00)+Rnd(254)+1
  44.             Doke AD+10,P
  45.             Inc TT
  46.          End If 
  47.       End If 
  48.       AD=AD+L
  49.    Loop 
  50.    If TT
  51.       A$="I have locked"+Str$(TT)+" procedure"
  52.       If TT>1 : A$=A$+"s" : End If 
  53.       A$=A$+"."
  54.    Else 
  55.       A$="No procedures to lock!"
  56.    End If 
  57.    Centre A$
  58. End Proc
  59. Procedure BYEBYE
  60.    Print : Print 
  61.    Centre "Press any key"
  62.    Wait Key : Screen Close 7 : Edit 
  63. End Proc